package com.zlx.store.domain.entity.vo;

import com.zlx.store.domain.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TokenVO {
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 用户名
     */
    private String username;
    /**
     * 用户角色id
     */
    private Integer userRole;
    /**
     * 拥有的店铺id
     */
    private List<Long> storeIds;
//    /**
//     * 当前的店铺id
//     */
//    private Long storeId;
    public TokenVO build(User user,List<Long> storeIds){
        this.userId=user.getUserId();
        this.username=user.getUserName();
        this.userRole=user.getUserRole();
        this.storeIds=storeIds;
        return this;
    }
}
